//
//  Helper.h
//  Uchat
//
//  Created by 李鹏飞 on 2017/10/23.
//  Copyright © 2017年 AFlyLi. All rights reserved.
//

//依赖于AFNetworking , SVProgressHUD

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


@interface Helper : NSObject

+(NSString *)getToken;
+(void)loginWithToken:(NSString *)token iAlias:(NSString *)iAlias;

- (void)air;//11111111

-（void）me；

+ (void)logout;

+ (UITabBarItem *)tabBarItemWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage tag:(NSInteger)tag;
//是否开通定位权限
+(BOOL)determineWhetherTheAPPOpensTheLocation;
//获取网络状态
+ (void)getNetworkState;
//get
+ (void)get:(NSString *)url parameters:(NSDictionary *)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;
//post
+ (void)post:(NSString *)url parameters:(NSDictionary *)parameters success:(void (^)(id responseObject))success failure:(void (^)(NSError *error))failure;

//验证手机格式
+ (BOOL)isValidateMobile:(NSString *)mobile;
//验证邮箱格式
+ (BOOL)validateEmail:(NSString *)email;
//验证用户名格式(2-16位,汉字或英文开头,不能输入空格)
+ (BOOL)ValidateName:(NSString *)name;

+ (NSDictionary *)jiexiJson:(NSString *)jsonName;
+(NSDictionary *)getDateDicformatter;

+(NSString *)getNowTimeStrWithformatter:(NSString *)format;

+(NSInteger)getNowTimestamp;
+(NSInteger)timeSwitchTimestamp:(NSString *)formatTime andFormatter:(NSString *)format;
+(NSString *)timestampSwitchTime:(NSInteger)timestamp andFormatter:(NSString *)format;
+ (NSString *)jsonStringWithArray:(NSMutableArray *)array;
+ (NSString *)jsonStringWithDic:(NSDictionary *)dict;
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
+ (NSArray *)arrayWithJsonString:(NSString *)jsonString;
+ (BOOL)isBlankString:(NSString *)string;
@end

//改变字符串中个别字体颜色 , 字体样式 和 字体大小
@interface NSString (HightLight)
//通过分隔符
+ (NSMutableAttributedString *)setHighLightText:(NSString *)str andSeparateStr:(NSString *)separateStr andLength:(NSInteger)length andColor:(UIColor *)color;
//通过索引
+ (NSMutableAttributedString *)setHighLightText:(NSString *)str FromWhere:(NSInteger)fromWhere andLength:(NSInteger)length andColor:(UIColor *)color;
//通过索引 改变字体样式和字体大小
+ (NSMutableAttributedString *)setHighLightText:(NSString *)str FromWhere:(NSInteger)fromWhere andLength:(NSInteger)length andColor:(UIColor *)color andFont:(UIFont *)font;

+ (BOOL)isMobilePhoneOrtelePhone:(NSString *)mobileNum;

- (BOOL)isChinese;
- (NSInteger)getToInt;
@end

